using System.Collections;
using ColorBox4Sitecore.RessourcesRegistation;

namespace ColorBox4Sitecore.Pipelines
{
    public class AddHeaderRessources
    {
        private ArrayList javascripts = new ArrayList();

        public void AddJavascripts(string js)
        {
            this.javascripts.Add(js);
        }

        private ArrayList stylesheets = new ArrayList();

        public void AddStylesheets(string css)
        {
            this.stylesheets.Add(css);
        }


        public void Process(AddHeaderRessourcesArgs args)
        {
            foreach (var js in javascripts)
            {
                args.RessourceList.Add(new Ressource { Path = (string)js, Type = RessourceType.Js });
            }

            foreach (var css in stylesheets)
            {
                args.RessourceList.Add(new Ressource { Path = (string)css, Type = RessourceType.Css });
            }
        }
    }
}